<extend name="Layout::member"/>
<block name="left">
    <div class="layout-menu" >
        <ul class="main-menu">
            <li>
                <button style="width:100%" type="button" class="btn btn-default btn-lg js-click1">会员管理</button>
            </li>
            <li class="js-toggle1" >
                <a class="menu-item" href="{:U('Price/index')}">
                    <i class="glyphicon glyphicon-time"></i>
                    <i class="icon pull-right"></i><span>报价会员</span>
                </a>
                <a class="menu-item" href="{:U('Fast/index')}">
                    <i class="glyphicon glyphicon-time"></i>
                    <i class="icon pull-right"></i><span>快速报价</span>
                </a>
                <a class="menu-item" href="{:U('Fast1/index')}">
                    <i class="glyphicon glyphicon-time"></i>
                    <i class="icon pull-right"></i><span>快速报价1</span>
                </a>
                <a class="menu-item" href="{:U('Order/index')}">
                    <i class="glyphicon glyphicon-time"></i>
                    <i class="icon pull-right"></i><span>预约会员</span>
                </a>
                <a class="menu-item" href="{:U('Match/index')}">
                    <i class="glyphicon glyphicon-time"></i>
                    <i class="icon pull-right"></i><span>匹配会员</span>
                </a>
            </li>
            <li>
                <button style="width:100%" type="button" class="btn btn-default btn-lg js-click2">设计师管理</button>
            </li>

            <li class="js-toggle2" style="display:none ">
                <a class="menu-item" href="{:U('Index/index')}">
                    <i class="glyphicon glyphicon-play-circle"></i>
                    <i class="icon pull-right"></i>
                    <span>预约列表</span>
                </a>
            </li>

            <li>
                <button style="width:100%" type="button" class="btn btn-default btn-lg js-click3">管理</button>
            </li>
            <li class="js-toggle3" style="display:none ">
                <a class="menu-item" href="{:U('Index/index')}">
                    <i class="glyphicon glyphicon-play-circle"></i>
                    <i class="icon pull-right"></i>
                    <span>匹配列表</span>
                </a>
            </li>

        </ul>
    </div>
</block>
<block name="content">
    <div class="layout-content">

        <div class="page-title">会员管理</div>

        <div class="content-top">
            <ul class="top-nav">
                <li class="active"><span>修改信息</span></li>
            </ul>
            <div class="clearfix"></div>
        </div>
        <div class="clearfix"></div>
        <!--content-main start-->
        <div class="container-fluid content-main">
            <div class="row">
                <div class="col-md-12">
                    <div id="tsk" class="ui-tips bg-info" style="display:none">
                        <span class="icon glyphicon glyphicon-info-sign"></span> <span  id="ts">提示信息提示信息提示信息提示信息提示信息提示信息。</span>
                    </div>

                    <form class="form-horizontal" onsubmit="return false">
                        <input type="hidden" value="{$list['id']}" class="js-id"/>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">用户名</label>
                            <div class="col-sm-5">
                                <input type="text"  class="form-control js-name" value="{$list['name']}"/>
                                <span class="help-block"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">手机号码</label>
                            <div class="col-sm-5">
                                <input type="text"  class="form-control js-mobile" value="{$list['mobile']}"/>
                                <span class="help-block"></span>
                            </div>
                        </div>


                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-8">
                                <button onclick="func()" style="margin-left: 90px;width: 150px" type="submit" class="btn btn-default">保存</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <!--content-main end-->
    </div>
    <script>
        function func(){
            var mobile=$('.js-mobile').val();
            if(mobile == ''){
                $('#tsk').css('display','block');
                $('#ts').html("手机号码不能为空");
                return false;
            }
            var name=$('.js-name').val();
            if(name == ''){
                $('#tsk').css('display','block');
                $('#ts').html("用户名不能为空");
                return false;
            }
            var id=$('.js-id').val();
            $.ajax({
                type:'POST',
                url:"{:U('Order/doUpdate')}",
                data:{'mobile':mobile,'name':name,'id':id},
                dataType:'json',
                success:function(data){
                   // alert(data);
                    //console.dir(JSON.parse(data));
                    //return false;
                    if(data==1){
                        $('#tsk').css('display','block');
                        $('#ts').html('修改成功');
                        setTimeout(function(){
                            location.href="{:U('Order/index')}";
                        },1000);
                    }else if(data==2){
                        $('#tsk').css('display','block');
                        $('#ts').html('修改失败');
                    }
                }
            })
        }
    </script>
</block>
